package com.ikun.yummy.manager;

import android.content.Context;

import com.ikun.yummy.bean.FollowInfo;
import com.ikun.yummy.sourceop.op.FollowOP;

import java.util.List;

public class FollowOPManager {
    private final FollowOP followOP;
    public FollowOPManager(Context context){
        followOP = new FollowOP(context);
    }
    public void insertFollowee(FollowInfo followInfo){
        followOP.insertFollowee(followInfo);
    }
    public void insertFollower(FollowInfo followInfo){
        followOP.insertFollower(followInfo);
    }
    public void deleteFollower(String followerid) {
        followOP.deleteFollower(followerid);
    }
    public void deleteFollowee(String followeeid) {
        followOP.deleteFollowee(followeeid);
    }
    public void delete(String follower,String followee){
       deleteFollowee(queryFolloweeSingle(followee,follower).followid);
       deleteFollower(queryFollowerSingle(follower,followee).followid);
    }
    public List<FollowInfo> queryFollower(String username){//查询followee都相等的follower
       return followOP.queryFollower(username);
    }
    public List<FollowInfo> queryFollowee(String username) {
     return followOP.queryFollowee(username);
    }
    public FollowInfo queryFollowerSingle(String username,String othername){
        return followOP.queryFollowerSingle(username,othername);
    }
    public FollowInfo queryFolloweeSingle(String username,String othername){
        return followOP.queryFolloweeSingle(username,othername);
    }
}
